package com.bsierp.business.pojo;

/**
 * PrivateProductId entity. @author MyEclipse Persistence Tools
 */

public class PrivateProductId implements java.io.Serializable {

    // Fields

    private User user;
    private Product product;

    // Constructors

    /** default constructor */
    public PrivateProductId() {
    }

    /** full constructor */
    public PrivateProductId(User user, Product product) {
        this.user = user;
        this.product = product;
    }

    // Property accessors

    public User getUser() {
        return this.user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public Product getProduct() {
        return this.product;
    }

    public void setProduct(Product product) {
        this.product = product;
    }

    public boolean equals(Object other) {
        if ((this == other))
            return true;
        if ((other == null))
            return false;
        if (!(other instanceof PrivateProductId))
            return false;
        PrivateProductId castOther = (PrivateProductId) other;

        return ((this.getUser() == castOther.getUser()) || (this.getUser() != null
                && castOther.getUser() != null && this.getUser().equals(
                castOther.getUser())))
                && ((this.getProduct() == castOther.getProduct()) || (this
                        .getProduct() != null
                        && castOther.getProduct() != null && this.getProduct()
                        .equals(castOther.getProduct())));
    }

    public int hashCode() {
        int result = 17;

        result = 37 * result
                + (getUser() == null ? 0 : this.getUser().hashCode());
        result = 37 * result
                + (getProduct() == null ? 0 : this.getProduct().hashCode());
        return result;
    }

}